package com.ftg.learn.mapper;

import com.ftg.learn.entity.EmployeeEntity;
import io.swagger.annotations.Api;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * 描述
 *
 * @author 布衣
 * @date 2025/7/4
 */
@Mapper
public interface EmployeeMapper {

    /**
     * 页面显示 数据
     * @param ename 姓名
     * @param page 页码
     * @param size
     * @return EmployeeEntity
     */
    List<EmployeeEntity> showall(@Param("ename") String ename, @Param("page") Integer page,@Param("size") Integer size);

    int getCount(@Param("ename") String ename);


    @Select("select * from employee where ename like concat(#{ename},'%')")
    List<EmployeeEntity> showAllByName(@Param("ename") String ename);

    @Insert("insert into employee(eid, ename, sex, edu, employed, birthday, salary)" +
            " values(#{eid},#{ename},#{sex},#{edu},#{employed},#{birthday},#{salary})")
    Integer addEmployee(EmployeeEntity employeeEntity);

    @Delete("delete from employee where eid=#{eid}")
    Integer deleteEmployee(@Param("eid") int eid);

    Integer updateEmployee(EmployeeEntity employeeEntity);

    Integer deleteByIds(List<Integer> eids);

    List<EmployeeEntity> pageHelperAll(String ename);


    List<EmployeeEntity> pageTest(@Param("name") String name);
}
